package 题目集.前缀和.二维前缀和;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.Arrays;

/**
 * https://www.acwing.com/problem/content/description/1267/
 * 离散化+前缀和：超时，正解是树状数组，二维偏序问题
 */
public class 数星星 {
    static int n;
    static int maxXY = 32002;
    static int[][] sum;

    public static void main(String[] args) {
        Reader sc = new Reader();
        n = sc.nextInt();
        int[][] arr=new int[n][2];
        for (int i = 0; i < n; i++) {
            arr[i][0]=sc.nextInt();
            arr[i][1]=sc.nextInt();
        }
        agge(arr);
        sum=new int[n+1][n+1];

        for (int i = 0; i < arr.length; i++) {
            sum[arr[i][0]][arr[i][1]]++;
        }

        int[] res = new int[n];
        for (int i = 1; i < sum.length; i++) {
            for (int j = 1; j < sum.length; j++) {
                int leftDown = sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1];
                if (sum[i][j] != 0) {
                    res[leftDown]++;
                }
                sum[i][j] += leftDown;
            }
        }
        for (int r : res) {
            System.out.println(r);
        }
    }

    public static void agge(int[][] arr) {
        Arrays.sort(arr, (a, b) -> a[0] - b[0]);
        int rank = 0;
        int pre = -1;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i][0] != pre) {
                rank++;
                pre = arr[i][0];
            }
            arr[i][0] = rank;
        }

        Arrays.sort(arr, (a, b) -> a[1] - b[1]);
        rank = 0;
        pre = -1;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i][1] != pre) {
                rank++;
                pre = arr[i][1];
            }
            arr[i][1] = rank;
        }
    }

    static class Reader {
        static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

        public Reader(Object... o) {
        }

        public int nextInt() {
            try {
                in.nextToken();
            } catch (Exception ignored) {
            }
            return (int) in.nval;
        }
    }
}
